package Text2;

/*
 *@Student 张策
 */
public class work3 {
    public static void main(String[] args) throws InterruptedException {
        T1 t1 = new T1();
        t1.setName("线程");
        t1.setPriority(Thread.MIN_PRIORITY);
        t1.start();
        for (int i = 0; i < 5; i++) {
            Thread.sleep(300);
            System.out.println("主线程666666");
        }
        System.out.println(t1.getPriority());//优先级
        t1.interrupt();
    }
}
class T1 extends Thread{
    @Override
    public void run() {
        while (true){
            for (int i = 0; i < 20; i++) {
                System.out.println("进行中");
            }
            try {
                System.out.println("休眠中");
                Thread.sleep(000);
            } catch (InterruptedException e) {
                System.out.println(Thread.currentThread().getName()+"终止");
            }
        }
    }
}
